package com.jfinal_demo.app;

import com.alibaba.druid.pool.DruidDataSource;
import com.jfinal.kit.PathKit;
import com.jfinal.plugin.activerecord.generator.Generator;

public class _Generator {
    public static void main(String[] args) {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8");
        dataSource.setUsername("root");

        String baseModelPkg = "com.jfinal_demo.app.model.base";
        String baseModelDir = PathKit.getWebRootPath() + "/src/main/java/com/jfinal_demo/app/model/base";
        String modelPkg = "com.jfinal_demo.app.model";
        String modelDir = baseModelDir + "/..";
        Generator generator = new Generator(dataSource, baseModelPkg, baseModelDir, modelPkg, modelDir);
        generator.generate();
    }
}
